import React, { Component } from 'react';
// import { Link } from 'react-router-dom';
// import { Layout, Card, Pagination } from 'element-react';

import './mvDetail.css'

class MvDetail extends Component {
  state = {
    id: null,
    mvDetail: []
  };
  // 组件加载完毕
  componentDidMount() {
    let that = this;
    let { id } = this.state;
    this.setState({
      id: that.props.match.params.id
    }, rs => {
      this.getMvDetailData();
    });

  }

  render() {
    const { mvDetail } = this.state;
    return (
      <div className="home">

      </div>
    );
  }
  // 获取MV详情
  getMvDetailData = () => {
    let that = this;
    let { mvDetail, id } = that.state;
    that.$post(that.$api.mvDetail, { mvid: id }).then(res => {
      if (res.code === 200) {
        console.log(res)
        that.setState({
          mvDetail: res.data
        }, r => {
          console.log(that.state.mvDetail)
        });

      }
    });
  }
}

export default MvDetail;
